home *** CD-ROM | disk | FTP | other *** search
- Path: news.csie.nctu.edu.tw!jkng
- From: jkng@csie.nctu.edu.tw (NortonNg)
- Newsgroups: comp.lang.c++
- Subject: Re: How to make a Complex class
- Date: 2 Jan 1996 00:58:21 GMT
- Organization: Dep. Computer Sci. & Information Eng., Chiao Tung Univ., Taiwan, R.O.C
- Message-ID: <4c9vvd$rjh@news.csie.nctu.edu.tw>
- References: <4c8kdm$p0q@news.csie.nctu.edu.tw> <4c984a$99t@atlas.axiom.net>
- NNTP-Posting-Host: jkng@ccsun39.csie.nctu.edu.tw
- X-Newsreader: TIN [version 1.2 PL2]
-
- Dave Nulton (dnult@axiom.net) ┤ú¿∞:
- : I've just been working with complex classes myself in C++. The
- : class is in there. There is already a library installed in my
- : compiler - use it by including <complex.h>. It defines a
- : structure you use called complex. Define a number something like
- : this.
- : complex(double r, double i);
- : As far as your format (typical mathmatical format) you'll have to
- : format you output and parse you input to make it work properly.
- : The advantage to the complex library is that most all of the math
- : functions and stream operators have been overloaded to handle the
- : complex math. In addition there are several standard functions.
- : The only thing not included is polar operators, but those are easy
- : to construct.
- : Hope that helps
- : -dnult
-
- Thanks for you help, but I still have a problem can not be overcomed.
- That is how to write to function which parse my input to make the complex
- class work properly. For instance, if I input (3+4.5i)*(2-8i)-(5i)
- the function must parse it and then do the correct answer.
- I don't know how to make it, hope you can make it. Thanks....
-
-
-